<?php

declare(strict_types=1);

namespace app\customer\controller;

use app\customer\controller\Base;
use think\Request;

class Upload extends Base
{

    protected $request;
    protected $service;
    protected $validate;

    public function __construct(Request $request)
    {
        $this->request = $request;
        $this->service = new \app\customer\service\Upload();
        // $this->validate = new \app\customer\validate\Customer();
    }


    /**
     * @describe
     * @author: Bobo
     * @date: 2024-06-28 11:38:15 
     * @param [type] @required
     * @return Renderable
     */
    public function upload()
    {
        $file =  $this->request->post('file');
        $result = $this->service->upload($file);
        return $this->returnJsonData($result['data'] ?? [], $result['code'], $result['message']);
    }
}
